<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/tags/trymore" prefix="tm"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix='fmt'%>

<script>
	function after_checkIn(json) {
		if (json.statusCode == 200) {
			// DWZ.ajaxDone(json);
			alertMsg.correct("项目已登记, 等待项目部长进行分配, 您可以进行相应材料的上传...");
			navTab.closeCurrentTab();
			
			var ele_rel = $("#menu_item_project_post");
			navTab.openTab(ele_rel.attr("rel"), 
				ele_rel.attr("href") + "&currentindex=1&op=post_stuff&flag=post&pid=" + json.json_data, 
				{
					title: ele_rel.attr("title"),
					fresh: true,
					icon : "icon-setflowmfin icon"
				}
			);
			
			$("div.accordion").find("div.selected").filter(":visible").removeClass("selected");
			ele_rel.parent().addClass("selected");
		} else {
			alertMsg.error(json.message);
		}
	}
	
	function after_switch(idx, op) {
		
	}
</script>

<!-- Body -->
<div class="unitBox" id="jbsxBox">
	<c:choose>
		<c:when test="${pid eq null}">
			<form method="post" action="app/project/checkin.do?action=actionSaveProject" class="pageForm required-validate" onsubmit="return validateCallback(this, after_checkIn);">
				<div class="pageContent">
					<%@ include file="../../public/form/formProject.jsp" %>
				</div>
				<div class="formBar">
					<ul>
						<ul>
							<li><div class="buttonActive"><div class="buttonContent"><button type="submit">项目登记</button></div></div></li>
						</ul>
					</ul>
				</div>
			</form>
		</c:when>
		<c:otherwise>
			<div class="pageContent">
				<!-- Tabs -->
				<div class="tabs" currentindex="${currentindex ne null ? currentindex : 0}" eventtype="click">
					<div class="tabsHeader">
						<div class="tabsHeaderContent">
							<ul>
								<li><a href="app/project/base.do?action=actionLoadProjectTab&pid=${pid}&tab=form&op=${op}&flag=post" class="j-ajax" callback="after_switch(0,'${op}')"><span>登记信息</span></a></li>
								<li><a href="app/project/base.do?action=actionLoadProjectTab&pid=${pid}&tab=material&op=${op}&flag=post" class="j-ajax" callback="after_switch(1,'${op}')"><span>材料区</span></a></li>
							</ul>
						</div>
					</div>
					<div class="tabsContent" style="height:auto;">
						<div inited="1000" style="display: none;"></div>
						<div inited="1000" style="display: block;"></div>
					</div>
					<div class="tabsFooter">
						<div class="tabsFooterContent"></div>
					</div>
				</div>
			</div>
		</c:otherwise>
	</c:choose>
</div>